package com.xbongbong.saas.factory.publicrule;

import com.alibaba.fastjson.JSONObject;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.saas.domain.entity.ClueRuleEntity;
import com.xbongbong.saas.domain.entity.RuleClueEntity;
import com.xbongbong.sys.domain.entity.UserEntity;

import java.util.List;

public interface ICheckClueRule {

    /**
     * 获取规则需要退回公海的线索列表 （打标签用）
     * @param userEntity 用户
     * @param rule 规则
     * @param clueList 用户的线索列表（不一定是所有的线索）
     * @param advanceTime 提前量
     * @return
     * @throws XbbException
     */
    List<RuleClueEntity> getBackClueList(UserEntity userEntity, ClueRuleEntity rule, List<RuleClueEntity> clueList, Integer advanceTime) throws XbbException;

    /**
     * 获取规则需要退回公海的线索列表
     * @param userEntity 用户
     * @param rule 规则
     * @param clueList 用户的线索列表（不一定是所有的线索）
     * @return
     * @throws XbbException
     */
    List<RuleClueEntity> getBackClueList(UserEntity userEntity, ClueRuleEntity rule, List<RuleClueEntity> clueList) throws XbbException ;

    /**
     * 判断在该规则下，员工是否可以获取线索
     *
     * @param rule       规则信息
     * @param corpid     公司id
     * @param userEntity 用户
     * @param clueId     需获取的线索
     * @param data
     * @return
     * @throws XbbException
     */
    boolean canGainClue(ClueRuleEntity rule, String corpid, UserEntity userEntity, Long clueId, int dataIdSize, JSONObject data) throws XbbException;
}
